package edu.sctu.practice.class02.Wangpeng.Assign03;

/**
 * Created by wp on 2015/11/4.
 */
public class Cilent {
    public static void main(String[] args) {
        GeometricObject geoObject1=new Circle(4);
        GeometricObject geoObject2=new Rectangle(6,2);

        System.out.println("这两个图形的面积相等吗？"+equalArea(geoObject1,geoObject2));
        displayGeometricObject(geoObject1);
        displayGeometricObject(geoObject2);
    }

    static boolean equalArea(GeometricObject object1,GeometricObject object2){
        return object1.findArea()==object2.findArea();
    }
    static void displayGeometricObject(GeometricObject object){
        System.out.println();
        System.out.println(object.toString());
        System.out.println("面积是"+object.findArea());
        System.out.println("周长是"+object.findPerimeter());
    }
}
